<template>
  <div class="wrapper">
    <div id="three" style="width: 100%; height: 100%"></div>
  </div>
</template>

<script>
import * as echarts from "echarts";
export default {
  name: "Leftthree",
  mounted() {
    this.getList();
  },
  methods: {
    getList() {
      // 基于准备好的dom，初始化echarts实例
      const chartDom = document.getElementById("three");
      const myChart = echarts.init(chartDom);

      var option = {
        title: {
          text: "大洲感染人数饼状图",
          left: "center",
          textStyle: {
            color: "#fff",
            fontSize: "22",
          },
        },
        tooltip: {
          trigger: "item",
        },
        legend: {
          bottom: "2%",
          left: "center",
        textStyle: {
            color: "#fff",
            fontSize: "15",
          },
        },
        series: [
          {
            name: "Access From",
            type: "pie",
            radius: ["40%", "70%"],
            avoidLabelOverlap: false,
            label: {
              show: false,
              position: "center",
            },
            labelLine: {
              show: false,
            },
            data: [
              { value: 1048, name: "Search Engine" },
              { value: 735, name: "Direct" },
            ],
          },
        ],
      };

      myChart.setOption(option);
    },
  },
};
</script>

<style lang="scss" scoped>
.wrapper {
  width: 100%;
  height: 100%;
}
</style>